package com.example.sys.controller;

import com.example.common.utils.R;
import com.example.sys.service.MenuService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author 罗文斌
 * @Date 2023/7/21
 * @Version 1.0.0
 */
@RestController
@RequestMapping("/menu")
public class MenuController {

    @Resource
    private MenuService menuService;
    @PostMapping("/get")
    public R getMenus(@RequestBody String params) {
        return menuService.getMenus(params);
    }

    @PostMapping("/all")
    public R getAllMenus() {
        return menuService.getAllMenus();
    }

    @PostMapping("/add")
    public R addMenu(@RequestBody String params) {
        return menuService.addMenus(params);
    }

    @PostMapping("/update")
    public R updateMenu(@RequestBody String params) {
        return menuService.updateMenus(params);
    }

    @PostMapping("/remove")
    public R removeMenu(@RequestBody String params) {
        return menuService.removeMenu(params);
    }
}
